Skip to content

test(aggregator): behavioural tests for bandLaneChart (#8600) - #8654

Merged
dezren39 merged 1 commit into
mainfrom
queue/14915-8600-bandlane-test
Nov 11, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/14915-8600-bandlane-test

Conversation

@dezren39

@dezren39 dezren39 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Fixes #8600.

What

The Cost Explorer band lane charts (PR #3972) had no behavioural test: aa.test.ts only asserted the emitted page contains the renderer's source strings, and bandLaneChart never executed against data.

New test/band-lane-chart.test.ts extracts the real bandLaneChart and its helpers (esc, fmt$, fmtT, fmtN, shortLabel, ESHORT) verbatim from the emitted explorer script in renderAa's page — no copies — and runs them against known band data:

  • Members range vs choices points: a member-only $500 stretches the axis (last tick $500.00) but draws no point; 3 members / 2 choices → exactly 2 plotted circles.
  • Log-scale geometry: costs 0.5 / 5 / 500 land at cx 232.0 / 402.7 (log thirds of the 512-wide plot); lane jitter cy 38.0 / 40.5 pins the pointY-vs-cy behaviour in executed form.
  • Leader identity/styling: choices[0] (or an explicit band.leader by key) renders r=5, white stroke, 0.95 opacity, "— band leader"; others r=3.8 / 0.65 / "— near-leader".
  • lo === hi widening: single cost 10 → widened [10/1.4, 10·1.4], point at the log centre (488.0); single score 80 → [79, 81] on the linear scale, also centred.
  • Empty cases: no usable member values, or bands without choices, render "".

aa.test.ts: the five lane-chart source-string assertions (function bandLaneChart, class="xpl-band-lanes", the group-6 call-site text, const pointY / not-const cy) are removed in favour of the behavioural ones; the bandGroup composition and g6Lanes.push data-plumbing pins stay.

Tests

  • test/band-lane-chart.test.ts: 5 pass / 0 fail.
  • test/aa.test.ts cannot execute in the sandbox environment: its server-spawning beforeAll hook times out identically (0 pass / 1 fail) on a pristine worktree of the same base commit — pre-existing and unrelated; the file's edits are assertion removals only, and tsc --noEmit is clean for both touched files.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…string pins (#8600)

New test/band-lane-chart.test.ts extracts the real bandLaneChart + helpers verbatim from the emitted explorer script (renderAa page) and executes them against known band data: axis range comes from members while plotted points come from choices (a member-only $500 stretches the axis, last tick $500.00, but draws no point), log geometry (0.5/5/500 -> cx 232.0/402.7), leader vs near-leader styling (r 5/#fff/0.95 vs 3.8/0.65, explicit leader by key wins), the lo===hi widening for cost ([/1.4, *1.4], point at log centre 488.0) and score ([-1, +1], linear centre), and the empty render cases. Lane cy geometry (38.0/40.5) pins the pointY-vs-cy behaviour in executed form. aa.test.ts: the five lane-chart source-string assertions (function bandLaneChart, class=xpl-band-lanes, the group-6 call-site text, const pointY / not-const-cy) are removed in favour of these; bandGroup composition and g6Lanes.push data-plumbing pins stay. New file: 5 pass / 0 fail. aa.test.ts itself cannot run in this sandbox (its server-spawning beforeAll hook times out identically on a pristine worktree of the same base — pre-existing environmental).
@dezren39
dezren39 requested a review from a team as a code owner November 11, 2026 11:25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T11:27:12.016154Z 544502e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 27 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6525fea5-d196-49c5-9739-0e49dd42e9b4
Commits

Reviewing files that changed from the base of the PR and between 83b7cdc and 544502e.

Files selected for processing: 2

  • pm-stack/aggregator/test/aa.test.ts
  • pm-stack/aggregator/test/band-lane-chart.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 merged commit f44b820 into main Nov 11, 2026
1 of 10 checks passed
@dezren39
dezren39 deleted the queue/14915-8600-bandlane-test branch November 11, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aggregator(aa): Cost Explorer band lane charts have no behavioural test — only source-string assertions

1 participant